from multiprocessing import Pool
import time
import requests

def func(args):
    res = requests.get('http://localhost:5000/hotels?inDate=2015-04-09&outDate=2015-04-10')
    if res.status_code != 200:
        print('res: ', args, res.status_code)

if __name__ == "__main__":
    for ii in range(2000):
        p = Pool(5)     # 创建一个包含5个进程的进程池
        for i in range(50):
            p.apply_async(func=func, args=(i,))
        p.close()           # 等子进程执行完毕后关闭进程池
        p.join()
        # time.sleep(1)
